import request from '@/utils/request'

// 获取搜索的商品列表数据
export const getProList = (paramsObj) => {
  const { page, goodsName, sortType, categoryId } = paramsObj
  return request.post('/search/getSearchList', {
    page,
    goodsName,
    sortType,
    categoryId
  })
}

// 获取商品详情数据
export const getProDetail = (goodsId) => {
  return request.get('/goods/detail', {
    params: {
      goodsId
    }
  })
}

// 获取商品评价
export const getProComments = (goodsId, limit) => {
  return request.get('/comment/getComment', {
    params: {
      goodsId,
      limit
    }
  })
}
